package com.atguigu.atcrowdfunding.service.impl;

import com.atguigu.atcrowdfunding.service.UserService;
import com.atguigu.atcrowdfunding.bean.User;
import com.atguigu.atcrowdfunding.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * lcd  2020/3/22
 * Description:
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    public List<User> queryAll() {
        return userDao.queryAll();
    }

    public User query4Login(User user) {
        return userDao.query4Login(user);
    }

    @Override
    public List<User> queryPage(Map<String, Object> map) {
        return userDao.queryPage(map);
    }

    @Override
    public Integer queryCount(Map<String, Object> map) {
        return userDao.queryCount(map);
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public User findById(Integer id) {
        return userDao.findById(id);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(String id) {
        userDao.delete(id);
    }

    @Override
    public void deletes(Map<String, Object> map) {
        userDao.deletes(map);
    }

    @Override
    public void doAssignRole(Map<String, Object> map) {
        userDao.doAssignRole(map);
    }

    @Override
    public void undoAssignRole(Map<String, Object> map) {
        userDao.undoAssignRole(map);
    }

    @Override
    public List<Integer> findRoleIdsByUserId(Integer id) {
        return userDao.findRoleIdsByUserId(id);
    }

}
